<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
<title></title>
<%@ include file="/WEB-INF/component/commonCSS.jsp"%>
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
<div class="box box-primary" id="more" style="width:110px;height:35px;background-color:#222c32;position:absolute;z-index:9999;left:850px;top:100px;display:none;font-size:12px;border-top-color:#222c32;">
            <div class="box-body home-message" id="moreOp" >
            </div>
        </div>
	<section class="content-header">
		<h1>企业资质维护记录</h1>
		<ol class="breadcrumb">
			<li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i>首页</a></li>
		<li class="active"><a href="#">基础库管理</a></li>
			<li class="active"><a href="#">企业库</a></li>
			<li class="active"><a href="#">企业资质管理</a></li>
			<li class="active"><a href="#">维护记录</a></li>
		</ol>
	</section>
	<section class="content">
		<div class=" box box-success">
			<div class="box-body">
				<div class=" form-inline">
					<div class="form-group form-group-xs">
                    	<label>启用时间：</label>
							<div class="input-group">
		           				  <input class=" form-control" placeholder="企业资质有效期始" name="profileStarttime" id="profileStarttime" type="text" maxlength="128" value=""readonly="readonly" data-provide="datepicker" data-date-fmt="yyyy-MM-dd" placeholder="yyyy-MM-dd"
                                  onFocus="var endDate=$dp.$('crateTimeEnd');WdatePicker({maxDate:'#F{$dp.$D(\'crateTimeEnd\')}'})" />
		       				</div>
                    	<label>-</label>
							<div class="input-group">
		           				 <input class=" form-control" placeholder="企业资质有效期始" name="profileEndtime" id="profileEndtime" type="text" maxlength="128" value=""readonly="readonly" data-provide="datepicker" data-date-fmt="yyyy-MM-dd" placeholder="yyyy-MM-dd"
                       				onFocus="WdatePicker({minDate:'#F{$dp.$D(\'createTimeBegin\')}'})" />
		       				</div>
                    	</div>
                    <input type="button" id="selectDicCompType" onclick="likeQuery();" class="btn btn-success btn-sm" value="查  询">
                </div>
            </div>
        </div>
		<table class="jqgrid" id="gridlist"></table>
		<div id="gridpage"></div>
		<div class=" box box-warning bottongroup">
			<label id="allOk" class="btn btn-default btn-sm" onclick='javascript:history.go(-1)'>返    回</label>
		</div>

    </section>
    <%@ include file="/WEB-INF/component/commonJS.jsp"%>
    <script type="text/javascript">
        $(function () {
            $("#gridlist").jqGrid({
                url: "getStdCompprofileLogDataList.html?compprofileId=${compprofileId}",
                mtype: "POST",
                datatype: "json",
                autowidth: true,
                height: 270,                   	
                colNames: ['企业资质id','企业资质编码','企业资质名称','企业资质类型','资质图片地址','资质有效期开始日期', '资质有效期截止日期','状态','备注','更新时间','更新人'],
                colModel: [
						{ name: 'profileId',hidden:true, width: "0%",align: 'center',sortable: false},		
						{ name: 'profileCode', width: "100",align: 'center',sortable: false},
						{ name: 'profileName', width: "140",align: 'center' ,sortable: false},
						{ name: 'profileType', width: "120",align: 'center' ,sortable: false},
						{ name: 'profilePicAddr', width: "120",align: 'center' ,sortable: false,
							 formatter : function(val, opts, rowdata) {
				                    return "<a href=\"javascript:showImg('"+rowdata.profilePicAddr+"');\">"+rowdata.profilePicAddr+"</a>";
				                }   	
						},
						{ name: 'profileStarttimeStr', width: "140",align: 'center',sortable: false},
						{ name: 'profileEndtimeStr', width: "140", align: 'center',sortable: false},
						{ name: 'status', width: "40", align: 'center',sortable: false,
							formatter : function(val, opts, rowdata) {
								var temp='';
								if(val == 0){temp = '停用';}
								else if (val == 1){ temp = '启用'; }
								return temp;
							}
						},
						{ name: 'remarks', width: "80",align: 'center',sortable: false},
						{ name: 'updDatetimeStr', width: "140",align: 'center',sortable: false},
						{ name: 'updUser', width: "120",align: 'center',sortable: false,}
					
                ],
                rowNum: 20,
                rowList: [10, 20, 50,100],
                rownumbers: true,
                pager: "#gridpage",
                viewrecords: true,
                caption: "企业资质维护记录列表",
                jsonReader: {
                	repeatitems: false,
                	id: "compRegId"
                }
            });
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
        });
        
        function likeQuery(){
        	var profileStarttime  = $("#profileStarttime").val();
       	    var profileEndtime = $("#profileEndtime").val();
	       	$("#gridlist").jqGrid('setGridParam', {
	       		mtype:"post",
	       		postData:{
					"profileStarttime":profileStarttime,
					"profileEndtime":profileEndtime
			    },
	       	    page: 1 
	       }).trigger("reloadGrid");
       }
        
        function showImg(imgPath) {
			var url = "/medstgmini/acctInfo/toImg.html";
			$.HN.dialog.open({
				"id" : "showImg",
				"title" : "许可证",
				"url" : url,
				"data" : {
					"imgPath" : imgPath
				},
				"width" : 800,
				"height" : 400,
				"closefunc" : function(params) {
					if (params) {

					}
				}
			});
		}
    </script>
</body>
</html>